<%@ page import="mybatis.pojo.Grade" %>
<%@ page import="mybatis.services.GradeServerices" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2022/7/1
  Time: 15:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>通过表单添加新学生，注意日期和年级的处理</title>
</head>
<body>
<%
    List<Grade> all = GradeServerices.ME.findAll();
%>
<form action="addStu.jsp">
    学生姓名：<input type="text" name="sname"><br/>
    性别:<input type="radio" name="gender" value="male"/>男
    <input type="radio" name="gender" value="female" checked/>女
    <input type="radio" name="gender" value="ghost"/>妖
    <input type="radio" name="gender" value="pghost"/>人妖<br/>
    电话号码：<input type="tel" name="phone"> <br/>
    qq:<input type="tel" name="qq"><br/>
    微信<input type="tel" name="wechat"><br/>
    年级编号：<select name="gradeId">
    <%
        for (Grade grade : all) {
    %>
    <option>
        <%=grade.getId()%>
    </option>
    <% } %>

</select><br/>
    入学日期:<input type="date" name="enterDate"><br/>
    来自城市:<input type="text" name="city"><br/>
    出生日期:<input type="date" name="birth"><br/>
    家庭地址：<input type="text" name="address"><br/>
    通行密码：<input type="password" name="psd"><br/>
    身份证号：<input type="text" name="idCard"><br/>
    <button>添加新生</button>
</form>

<%

%>

</body>
</html>
